Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operations with an event stream member shape must have ValidationException #3814

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

drganjoo
Copy link
Contributor

@drganjoo drganjoo commented Sep 3, 2024

This PR addresses an issue where, if an operation's input includes an event streaming member, the builder for the operation input or output may raise a ConstraintViolation when build_enforcing_all_constraints is called and the event streaming member field is not set. This occurs because the member shape is required.

The standard error message that is shown when ValidationException is not attached to an operation is also displayed in this case:

Operation test#TestOperation takes in input that is constrained (https://awslabs.github.io/smithy/2.0/spec/constraint-traits.html), and as such can fail with a validation exception. You must model this behavior in the operation shape in your model file.

use smithy.framework#ValidationException

operation TestOperation {
    ...
    errors: [..., ValidationException] // <-- Add this.
}

Closes: 3813

@drganjoo drganjoo added the server Rust server SDK label Sep 3, 2024
Copy link

github-actions bot commented Sep 3, 2024

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

github-actions bot commented Sep 4, 2024

A new generated diff is ready to view.

A new doc preview is ready to view.

@drganjoo drganjoo marked this pull request as ready for review September 4, 2024 14:48
@drganjoo drganjoo requested review from a team as code owners September 4, 2024 14:48
@drganjoo drganjoo added the breaking-change This will require a breaking change label Sep 4, 2024
@drganjoo drganjoo added this pull request to the merge queue Sep 4, 2024
Merged via the queue into main with commit 2c3a4c1 Sep 4, 2024
44 checks passed
@drganjoo drganjoo deleted the fahadzub/event-stream branch September 4, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will require a breaking change server Rust server SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

operationShapesThatMustHaveValidationException does not account for event streaming members.
2 participants